package com.wjm.plugin;

import android.app.Activity;
import android.content.res.AssetManager;
import android.content.res.Resources;

/**
 * 此base在hook插件化中必须要写，因为此时插件中的资源是通过宿主的应用上下文来加载的
 */
public class BaseActivity extends Activity {

    @Override
    public AssetManager getAssets() {
        if (null != getApplication() && null != getApplication().getAssets()) {
            return getApplication().getAssets();
        }
        return super.getAssets();
    }

    @Override
    public Resources getResources() {
        if (null != getApplication() && null != getApplication().getResources()) {
            return getApplication().getResources();
        }
        return super.getResources();
    }
}
